<div class="card">
    <div class="card-header"><i class="far fa-calendar-alt"></i> Archives</div>
    <div class="card-body">
        @foreach (IGrouping<int, IDocument> yearGroup in Outputs
            .FromPipeline(nameof(Statiq.Web.Pipelines.Content))
            .FilterSources("blog/posts/*")
            .Where(doc => doc.GetDateTime(WebKeys.Published).Year > 2000)
            .GroupBy(doc => doc.GetDateTime(WebKeys.Published).Year)
            .OrderByDescending(x => x.Key))
        {            
            <h5 class="card-title">@(yearGroup.Key)</h5>
            <div class="card-text mb-2">
            @foreach (IGrouping<(string, string), IDocument> monthGroup in yearGroup
                .Where(doc => doc.GetDateTime(WebKeys.Published).Year > 2000)
                .GroupBy(doc => (doc.GetDateTime(WebKeys.Published).ToString("MM"), doc.GetDateTime(WebKeys.Published).ToString("MMMM")))
                .OrderByDescending(x => x.Key.Item1))
            {
                <div><a href="/blog/@(yearGroup.Key)/@(monthGroup.Key.Item1)">@monthGroup.Key.Item2 (@monthGroup.Count())</a></div>
            }
            </div>
        }
    </div>
</div>
